{% extends 'base.html' %}
{% block author_active %}
    active
{% endblock %}

{% load my_tags %}

{% block content %}


    <h3 class="sub-header">出版社列表</h3>
    <div class="table-responsive">

        <a class="btn btn-primary btn-sm" href="/publisher_add/"> 添加 </a>

        <table class="table table-striped">
            <thead>
            <tr>
                <th>序号</th>
                <th>ID</th>
                <th>作者姓名</th>
                <th>著作</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>

            {% for author in all_authors %}
                <tr>
                    <td>{{ forloop.counter }}</td>
                    <td>{{ author.pk }}</td>
                    <td>{{ author.name }}</td>
                    <td>
                        {% for book in author.books.all %}
                            《{{ book }}》

                        {% endfor %}

                    </td>
                    <td>
                        <a href="/author_del/?pk={{ author.pk }}">删除</a>
                        <a href="/author_edit/?pk={{ author.pk }}">编辑</a>

                    </td>

                </tr>
            {% endfor %}


            </tbody>
        </table>


        {% page 5 %}

    </div>




{% endblock %}